﻿
/*自动填充*/
function cheak(e){
var keyword=$(e).val();
var box=$("#search_box").offset();
var win=$(document).width();
var Rleft= win-box.left-$("#search_box").width()-2;
var Rtop=box.top+$("#search_box").height();

if(keyword=="" ){

}else{

		$.ajax({
			url:"../public_files/action_ajax.php",
			type:"post",
			dataType:"html",
			data: "keyword="+keyword,
			success:function(date){
			
			
			$(".search_result").css({"display":"block","right":Rleft,"top":Rtop});
				$(".search_result").html(date);
			},
			error:function (XMLHttpRequest, textStatus, errorThrown){
			alert(XMLHttpRequest+textStatus+errorThrown);
			}

		}); 
	}
}
function hide_result(){

$(".search_result").css({"display":"none"});
}



function search(e){



$(e).css("background-color","#ddd");

$(e).mouseout(function(){
$(e).css("background-color","#fff");
});

}


function tianchong(e){

var keyword=$(e).html();
$("#search_box").attr("value",keyword);
$("#Submit").trigger("click");
$(".search_result").css({"display":"none"});
}





/* 搜索的分页*/
function search_fenye(page,type,pagenum,str_id,a,b){
$.ajax({
type:"POST",
url:"../public_files/AjaxSearchFenye.php",
dataType:"text",
data: "page="+page+"&str_id="+str_id+"&type="+type+"&pagenum="+pagenum,
success:function(date){
if(type==0){
$(".power_list_content").html(date);
}else{
$(".user_list_content").html(date);
}
}
});

}

